% locks the proper synapse in connectome 
% passed to the function as obj. Function sets defined recharging time as
% the recharging time (starts count down to the reactivate this synapse)
% and sets its activie status as 0 (that means "inactive")

function lockSynapsesFromNeuron(obj,layer,neuronId)
    for i=1:length(obj.synapses)
        if((obj.synapses(1,i).inputNeuronId == neuronId) && (obj.synapses(1,i).inputNeuronLayer == layer))
            obj.synapses(1,i).remainingTime = obj.synapses(1,i).definedRechargingTime;
            obj.synapses(1,i).active = 0;
        end
    end
end

